<template>
	<view class="content">
		<button class="size" @tap="createVideoPlayer">创建VideoPlayer对象</button>
		<button class="size" @tap="createLivePusher">创建LivePusher对象</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				player: null,
				w:null,
			  pusher:null
			}
		},
		methods: {
			createVideoPlayer() {
				// 创建一个新Webview窗口
				this.w = plus.webview.create('/hybrid/html/local.html','/hybrid/html/local.html',{
					top:'0px',
					bottom:'0px',
					background:"#ccc",
					backgroundColorTop:"rgba(255,0,0,0.5)",
					backgroundColorBottom:"rgba(255,0,0,0.5)" // 底部窗口背景色
				});
				this.w.show(); // 显示窗口
			},
			createLivePusher(){
				// 创建LivePusher对象
				this.pusher = plus.webview.create('/hybrid/html/pusher.html','/hybrid/html/pusher.html',{
					top:'0px',
					bottom:'0px',
					background:"#ccc",
					backgroundColorTop:"rgba(255,0,0,0.8)",
					backgroundColorBottom:"rgba(255,0,0,0.8)" // 底部窗口背景色
				});
				this.pusher.show(); 
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}

	.size {
		margin: 30rpx 0;
	}
</style>
